import { request } from '@/utils/request'

// /api/address/book/page
// 获取常用电话列表
export const getAddressBook = (params: object) => {
  return request({
    url: '/api/address/book/page',
    method: 'GET',
    data: params
  })
}

// /api/notice/page
// 获取公告列表
export const getNoticeList = (params: object) => {
  return request({
    url: '/api/notice/page',
    method: 'GET',
    data: params
  })
}
// /api/notice/detail
// 获取公告详情
export const getNoticeDetail = (params: object) => {
  return request({
    url: '/api/notice/detail',
    method: 'GET',
    data: params
  })
}

// /api/community/page
// 获取小区信息
export const getCommunityPage = (params: object) => {
  return request({
    url: '/api/community/page',
    method: 'GET',
    data: params
  })
}
// /api/community/region/page
// 获取区域列表
export const getRegionPage = (params: object) => {
  return request({
    url: '/api/community/region/page',
    method: 'GET',
    data: params
  })
}
// /api/floor/page
// 获取楼栋列表
export const getFloorPage = (params: object) => {
  return request({
    url: '/api/floor/page',
    method: 'GET',
    data: params
  })
}
// /api/building/room/page
// 获取房屋列表
export const getBuildingRoomPage = (params: object) => {
  return request({
    url: '/api/building/room/page',
    method: 'GET',
    data: params
  })
}
// 检测是否存在业主
// /api/community/member/building/record/checkExistOwner
export const checkExistOwner = (roomId: number) => {
  return request({
    url: `/api/community/member/building/record/checkExistOwner?roomId=${roomId}`,
    method: 'POST'
  })
}
